package edu.sctu.zcy.month201506.day20150613;

import java.util.Calendar;
import java.util.Timer;
import java.util.TimerTask;

/**
 * Created by wswk on 2015/6/13.
 */
public class TimerDemo {

    private Timer timer = new Timer("时间") ;

    public void time(Calendar calendar){

        timer.schedule(new TimerTask() {
            @Override
            public void run() {

                for (int i = 0; i < 10; i++) {
                    System.out.println(i);
                }

            }
        },calendar.getTime());
    }

    public Timer getTimer() {
        return timer;
    }

    public void setTimer(Timer timer) {
        this.timer = timer;
    }
}
